import update from "immutability-helper"
import {
    GET_PERSON_ASSESS,
} from "../actions"
import {cloneDeep} from "lodash"

const initialState = {
  nowPerson: {}
}

const handlers = {
  [GET_PERSON_ASSESS]: (state, data = {content: []}) => {
    return update(state, {$merge: {
      nowPerson: data
    }})
  }
}

export default (state = initialState, action) => {
  const {type, data} = action
  if (!handlers[type]) {return state}
  return handlers[type](state, data)
}
